package PTA;

class Account{
	private int balance;
	public Account(int money){
		this.balance = money;
	}
	public int getBalance() {
		return balance;
	}
	public synchronized void deposit(int money){
		balance = balance + money;
	}
	public synchronized void withdraw(int money) throws IllegalStateException {
		balance = balance - money;
		if(balance<0) 
	        throw new IllegalStateException(balance+"");	
	}
	
}


public class Main4 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
